<!DOCTYPE html>
<html>
<head>
<title>Overview Map</title>
<meta charset="utf-8">
<script src="http://weapp.googlecode.com/svn/api/weapp.min.js"></script>

<style type="text/css">
html, body {
    margin: 0px;
    width: 100%;
    height: 100%;
}
</style>

<script>
WeApp.OverviewMap = Weiran.Class(WeApp, {
    // {OpenLayers.Control.WeOverviewMap}
    weOverviwMap: null,

    initialize: function (options) {
        WeApp.prototype.initialize.apply(this, arguments);
    },

    run: function () {
        WeApp.prototype.run.apply(this, arguments);
        
        // create a WeOverviewMap control within the window
        this.weOverviwMap = new OpenLayers.Control.WeOverviewMap();
        this.weOverviwMap.setMap(this.getMap());
        var div = this.weOverviwMap.draw();
        if (div) {
            document.body.appendChild(div);
        }
    },
    
    destroy: function () {
        // destroy the WeLayerSwitcher control
        this.weOverviwMap.destroy();
        this.weOverviwMap = null;
        
        WeApp.prototype.destroy.apply(this, arguments);
    },

    CLASS_NAME: "WeApp.OverviewMap"
});

</script>
</head>

<body>
<script>
    var app = new WeApp.OverviewMap();
    app.run();
</script>
</body>
</html>
